import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity("student_database", { schema: "alumni" })
export class StudentDatabase {
  @PrimaryGeneratedColumn({ type: "int", name: "id", unsigned: true })
  id: number;

  @Column("varchar", { name: "school", length: 20 })
  school: string;

  @Column("varchar", { name: "name", length: 20 })
  name: string;

  @Column("tinyint", {
    name: "gender",
    comment: "性别,1:男2女",
    unsigned: true,
    default: () => "'0'",
  })
  gender: number;

  @Column("int", { name: "level", default: () => "'0'" })
  level: number;

  @Column("year", { name: "biye_year", nullable: true, comment: "毕业年份" })
  biyeYear: number | null;

  @Column("varchar", { name: "class_name", length: 20 })
  className: string;
}
